import React from 'react';
import { render } from 'react-dom';
import { Router, Route, IndexRoute } from 'react-router';
import MainView from './MainView.jsx';
import RootView from './RootView.jsx';
import DrillView from './DrillView.jsx';
import history from '../common/history.es6';

render((
  <Router history={ history }>
    <Route path="/" component={MainView}>
      <Route path="devicetype/:devicetypeId" component={DrillView} />
      <Route path="devicetype/:devicetypeId/manufacturer/:manufacturerId" component={DrillView} />
      <Route path="devicetype/:devicetypeId/manufacturer/:manufacturerId/model/:modelId" component={DrillView} />
      <IndexRoute component={RootView} />
    </Route>
  </Router>
), document.getElementById('root'));
